home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / batch / tsbat36.zip / ZOO2ZIPH.BAT < prev   
DOS Batch File  |  1992-02-04  |  4KB  |  156 lines

  1. echo off
  2. rem
  3. rem Do not distribute ZOO2ZIPH.BAT separately from the rest of the package
  4. rem
  5.  
  6. rem If you get an "Out of environment space" message, increase your
  7. rem environment space by using shell configuration in config.sys:
  8. rem Example: shell=c:\bin\command.com /e:1024 /p
  9.  
  10. echo.
  11. echo ┌───────────────────────────────────────────────────────────────┐
  12. echo │ Convert and datestamp a single .zoo to .zip file with comment │
  13. echo │ By Prof. Timo Salmi, ts@chyde.uwasa.fi, Tue 4-Feb-1992        │
  14. echo └───────────────────────────────────────────────────────────────┘
  15. if not "%1"=="" goto _continue
  16. echo.
  17. echo Usage: ZOO2ZIPH PackageName [/r(eplace the old .zoo with the new .zip)]
  18. echo Use no drive name! No extension!
  19. echo        ┌───────────────┐
  20. echo        │ NO WILDCARDS! │
  21. echo        └───────────────┘
  22. echo.
  23. echo When using for the first time:
  24. echo  1) Make zoo.exe, pkzip.exe, and scan.exe available (not provided)
  25. echo  2) Make a new directory e:\arczip\zip for converted files
  26. echo  3) Edit your own zip-file comment to e:\arczip\comment.txt (not provided)
  27. echo.
  28. echo Usually:
  29. echo  Place the .zoo file in directory e:\arczip\arc
  30. echo  And run normally
  31. echo.
  32. echo.
  33. echo.
  34. goto _out
  35.  
  36. :_continue
  37. rem Do the necessary program and comment files exist
  38. if not exist c:\tools\pkzip.exe goto _err1
  39. if not exist c:\box\boxtools\zoo.exe goto _err2
  40. if not exist e:\arczip\comment.txt goto _err3
  41. if not exist e:\arczip\zip\nul goto _err8
  42. if not exist c:\tools\scan.exe goto _err11
  43.  
  44. rem Check that no wildcards or extension was used
  45. for %%f in (%1) do if "%%f"=="%1" goto _ok
  46. echo.
  47. echo Wildcards / extensions not allowed in %1
  48. goto _out
  49.  
  50. :_ok
  51. rem Build the names for source .zoo and target .zip files
  52. set _filea=e:\arczip\arc\%1.zoo
  53. set _filez=e:\arczip\zip\%1.zip
  54. if not exist %_filea% goto _err4
  55. if exist %_filez% goto _err5
  56. if not exist e:\arczip\tmp$$$\nul md e:\arczip\tmp$$$
  57. if exist e:\arczip\tmp$$$\*.* goto _err9
  58.  
  59. rem Test .zoo archive integrity
  60. c:\box\boxtools\zoo -test %_filea%
  61. if errorlevel==1 goto _err10
  62.  
  63. rem Unpack and check for viruses
  64. e:
  65. cd \arczip\tmp$$$
  66. c:\box\boxtools\zoo e %_filea% 
  67. c:\tools\scan /m /nomem /x e:\arczip\tmp$$$
  68. if errorlevel==1 goto _err12
  69.  
  70. rem Convert, use the date of the latest file, not the current date
  71. pkzip -a %_filez% e:\arczip\comment.txt
  72. pkzip -z %_filez% < e:\arczip\comment.txt
  73. pkzip -d %_filez% comment.txt
  74. pkzip -br:\ -u -m -o %_filez% e:\arczip\tmp$$$\*.*
  75. pkzip -v %_filez%
  76. dir %_filez%
  77. cd \arczip
  78. rd e:\arczip\tmp$$$
  79.  
  80. rem State of the /r switch for replacing the old .zoo file
  81. if "%2"=="/r" goto _replace
  82. if "%2"=="/R" goto _replace
  83. goto _out
  84.  
  85. rem Replace the old .zoo file with the new .zip file
  86. :_replace
  87. echo.
  88. echo To delete %_filea% press any key
  89. echo To cancel, use the Break key now
  90. pause >nul
  91. if not exist %_filez% goto _err6
  92. if exist %_filea% del %_filea%
  93. if exist %_filea% goto _err7
  94. echo.
  95. echo File %_filea% deleted
  96. goto _out
  97.  
  98. :_err1
  99. Echo File c:\tools\pkzip.exe not found
  100. goto _out
  101.  
  102. :_err2
  103. Echo File c:\box\boxtools\zoo.exe not found
  104. goto _out
  105.  
  106. :_err3
  107. Echo File e:\arczip\comment.txt not found
  108. goto _out
  109.  
  110. :_err4
  111. Echo File %_filea% not found
  112. echo.
  113. echo Usage: ZOO2ZIPH PackageName [/r(eplace the old .zoo with the new .zip)]
  114. echo Use no drive name! No extension!
  115. echo        ┌───────────────┐
  116. echo        │ NO WILDCARDS! │
  117. echo        └───────────────┘
  118. goto _out
  119.  
  120. :_err5
  121. Echo File %_filez% already exists
  122. goto _out
  123.  
  124. :_err6
  125. Echo ZOO2ZIPH aborted: File %_filez% not found
  126. goto _out
  127.  
  128. :_err7
  129. Echo ZOO2ZIPH aborted: Disk or file %_filea% is readonly
  130. goto _out
  131.  
  132. :_err8
  133. Echo Error: Directory e:\arczip\zip does not exist
  134. goto _out
  135.  
  136. :_err9
  137. Echo Error: Directory e:\arczip\tmp$$$ is not empty
  138. goto _out
  139.  
  140. :_err10
  141. Echo ZOO2ZIPH aborted: Error in %_filea%
  142. goto _out
  143.  
  144. :_err11
  145. Echo File c:\tools\scan.exe not found
  146. goto _out
  147.  
  148. :_err12
  149. Echo ZOO2ZIPH aborted: Scan reports problems in c:\arczip\tmp$$$
  150. goto _out
  151.  
  152. :_out
  153. set _filea=
  154. set _filez=
  155. echo on
  156.